package xyz.sicau.blog.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import xyz.sicau.blog.bean.Relation;

import java.util.List;

public interface RelationMapper {

    @Select("select * from relation where create_user_id=#{userId}")
    List<Relation> getRelation(int userId);

    /**
     * 插入新人员
     */
    int insertRelation(Relation relation);

    int updateRelation(Relation relation);

    @Delete("delete from relation where r_id=#{rId} and create_user_id=#{createUserId}")
    int deleteRelation(int rId, int createUserId);

}
